\hypertarget{class_i_pale_gem_framework}{\section{I\-Pale\-Gem\-Framework Class Reference}
\label{class_i_pale_gem_framework}\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}}
}


Interface for the game to the engine.  




{\ttfamily \#include $<$I\-Pale\-Gem\-Framework.\-h$>$}

Inheritance diagram for I\-Pale\-Gem\-Framework\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_i_pale_gem_framework}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual H\-R\-E\-S\-U\-L\-T \hyperlink{class_i_pale_gem_framework_ad0723b0f1d9f8b8e4baeb1916000f00a}{pg\-Init} (H\-I\-N\-S\-T\-A\-N\-C\-E h\-Instance, int cmd\-Show, L\-P\-C\-W\-S\-T\-R lp\-Game\-Title)=0
\begin{DoxyCompactList}\small\item\em Initialises the game engine and creates a game window. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_i_pale_gem_framework_a265588dcd93528d4449aa244fed92f56}{pg\-Update} ()=0
\begin{DoxyCompactList}\small\item\em Updates the engine and its subsystems. \end{DoxyCompactList}\item 
virtual H\-R\-E\-S\-U\-L\-T \hyperlink{class_i_pale_gem_framework_a7c0722e2ecb292f82771bfc4dde2c92b}{pg\-Exit} ()=0
\begin{DoxyCompactList}\small\item\em Shuts the engine down. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_i_pale_gem_framework_a16db0befad9f653ef6217aecba83087c}{pg\-Do\-Message\-Loop} ()=0
\begin{DoxyCompactList}\small\item\em Enters the windows message loop. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_i_pale_gem_framework_a8f309099c288fbd27be3a1131107b056}{pg\-Do\-Message\-Loop} (int($\ast$Update\-Function)(float f\-Frame\-Time))=0
\begin{DoxyCompactList}\small\item\em Enters the windows message loop and calls Update\-Function before updating the engine. \end{DoxyCompactList}\item 
virtual bool \hyperlink{class_i_pale_gem_framework_afc4e02c4fdca1ebdf3f929e64c974d55}{pg\-Check\-For\-Multiple\-Instances} (L\-P\-C\-W\-S\-T\-R lp\-Game\-Title)=0
\begin{DoxyCompactList}\small\item\em Checks if there's allready an instance of the game running. \end{DoxyCompactList}\item 
virtual bool \hyperlink{class_i_pale_gem_framework_ab5cec8d061abddec90a2bb9d60328ab0}{pg\-Check\-Hard\-Disk\-Space} (const D\-W\-O\-R\-D\-L\-O\-N\-G space\-Needed)=0
\begin{DoxyCompactList}\small\item\em Checks available memory on harddisk and returns true if theres enough. \end{DoxyCompactList}\item 
virtual bool \hyperlink{class_i_pale_gem_framework_a767e1c3dbaf56507a3abef6908cb5fe7}{pg\-Check\-R\-A\-M} (const D\-W\-O\-R\-D\-L\-O\-N\-G space\-Needed)=0
\item 
virtual bool \hyperlink{class_i_pale_gem_framework_a5e2f8a348cedf1a2e5a0a15e96df3a4f}{pg\-Check\-Avail\-R\-A\-M} (const D\-W\-O\-R\-D\-L\-O\-N\-G space\-Needed)=0
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interface for the game to the engine. 

\subsubsection*{General information\-:}

The Pale\-Gem engine framework represents the engine at its toplayer. Without it, the engine will not work and also isn't usable in the first place. The framework is a singleton class and therefore should not be instanced. Instead the makro g\-\_\-\-P\-G\-\_\-p\-Pale\-Gem\-Framework can be used to access the framework and its subsystems. Note that in the future (or if the future has come already, now) g\-\_\-\-P\-G\-\_\-p\-Pale\-Gem\-Framework and g\-\_\-\-P\-G\-\_\-p\-S\-Game\-Info are the only two globally accessible interfaces for the engine. Any other subsystems reside inside the framework, however makros are provided to ease accession of these systems. These makros are\-:
\begin{DoxyItemize}
\item g\-\_\-\-P\-G\-\_\-p\-Renderer \begin{DoxySeeAlso}{See Also}
\hyperlink{classpg_render}{pg\-Render}
\end{DoxySeeAlso}

\item g\-\_\-\-P\-G\-\_\-p\-Timer \begin{DoxySeeAlso}{See Also}
\hyperlink{classpg_timer}{pg\-Timer}
\end{DoxySeeAlso}

\item g\-\_\-\-P\-G\-\_\-p\-Framework\-Event\-Manager \begin{DoxySeeAlso}{See Also}
\hyperlink{classpg_event_manager}{pg\-Event\-Manager}
\end{DoxySeeAlso}

\item listend
\end{DoxyItemize}

\subsubsection*{Initializing the framework\-:}

\begin{DoxySeeAlso}{See Also}
\hyperlink{struct_s_game_info}{S\-Game\-Info}
\end{DoxySeeAlso}
B\-E\-F\-O\-R\-E you call \hyperlink{class_i_pale_gem_framework_ad0723b0f1d9f8b8e4baeb1916000f00a}{pg\-Init()}, you will have to provide some information for the framework. This is done by calling g\-\_\-\-P\-G\-\_\-p\-S\-Game\-Info-\/$>$Set\-Info(). If you don't provide a window handle (provide N\-U\-L\-L for the h\-Window param) the engine will create a window and name its class and the window itself after the game title you provided. If you fail to call g\-\_\-\-P\-G\-\_\-p\-S\-Game\-Info-\/$>$Set\-Info(), the game info subsystem will try to use defaults. This is not supported and no warranty whatsoever is provided for it to function.

\subsubsection*{Updating your game\-:}

\begin{DoxySeeAlso}{See Also}
\hyperlink{_i_event_manager_8h_acebeb2e728025f3444b405355a3f8e92}{E\-V\-E\-N\-T\-\_\-\-N\-A\-M\-E}
\end{DoxySeeAlso}
There are several ways to go about updating the engine and your game. You can either\-:
\begin{DoxyItemize}
\item call \hyperlink{class_i_pale_gem_framework_a16db0befad9f653ef6217aecba83087c}{pg\-Do\-Message\-Loop()} A\-F\-T\-E\-R you called \hyperlink{class_i_pale_gem_framework_ad0723b0f1d9f8b8e4baeb1916000f00a}{pg\-Init()}. This will enter a while loop inside the engine which will handle the windows message loop. It will call \hyperlink{class_i_pale_gem_framework_a265588dcd93528d4449aa244fed92f56}{pg\-Update()} which itself is responsible for the actual updating of the engine and its subsystems. By using this method the only way for your game to receive updates is to register a class with g\-\_\-\-P\-G\-\_\-p\-Pale\-Gem\-Fremawork-\/$>$Get\-Framework\-Event\-Manager()-\/$>$Register\-Listener().
\end{DoxyItemize}


\begin{DoxyItemize}
\item call pg\-Update to manually update the engine in your own windows message loop.
\end{DoxyItemize}


\begin{DoxyItemize}
\item call pg\-Do\-Message\-Loop(int ($\ast$\-Update) (float frame\-Time)), where Update is a function you provide. This way you don't need to use the framework event manager to update your game.
\end{DoxyItemize}


\begin{DoxyItemize}
\item call each subsystem's update function manually in your own message loop. This might just be the best solution as you can control precisely when which system will be updated. \begin{DoxySeeAlso}{See Also}
\hyperlink{classpg_pale_gem_framework_a12b9a4df14933e5bc2b41e9ceb081c60}{pg\-Pale\-Gem\-Framework\-::pg\-Update()} 
\end{DoxySeeAlso}

\end{DoxyItemize}

\subsection{Member Function Documentation}
\hypertarget{class_i_pale_gem_framework_a5e2f8a348cedf1a2e5a0a15e96df3a4f}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Check\-Avail\-R\-A\-M@{pg\-Check\-Avail\-R\-A\-M}}
\index{pg\-Check\-Avail\-R\-A\-M@{pg\-Check\-Avail\-R\-A\-M}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Check\-Avail\-R\-A\-M}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool I\-Pale\-Gem\-Framework\-::pg\-Check\-Avail\-R\-A\-M (
\begin{DoxyParamCaption}
\item[{const D\-W\-O\-R\-D\-L\-O\-N\-G}]{space\-Needed}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_a5e2f8a348cedf1a2e5a0a15e96df3a4f}


Implemented in \hyperlink{classpg_pale_gem_framework_a3158f62dccb47ed723eafec416162eb2}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_afc4e02c4fdca1ebdf3f929e64c974d55}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Check\-For\-Multiple\-Instances@{pg\-Check\-For\-Multiple\-Instances}}
\index{pg\-Check\-For\-Multiple\-Instances@{pg\-Check\-For\-Multiple\-Instances}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Check\-For\-Multiple\-Instances}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool I\-Pale\-Gem\-Framework\-::pg\-Check\-For\-Multiple\-Instances (
\begin{DoxyParamCaption}
\item[{L\-P\-C\-W\-S\-T\-R}]{lp\-Game\-Title}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_afc4e02c4fdca1ebdf3f929e64c974d55}


Checks if there's allready an instance of the game running. 


\begin{DoxyParams}{Parameters}
{\em lp\-Game\-Title} & Name of the game to check for \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if there's already an instance running 
\end{DoxyReturn}


Implemented in \hyperlink{classpg_pale_gem_framework_a1431d21992af42e6fd0ed3a3e9ee2614}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_ab5cec8d061abddec90a2bb9d60328ab0}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Check\-Hard\-Disk\-Space@{pg\-Check\-Hard\-Disk\-Space}}
\index{pg\-Check\-Hard\-Disk\-Space@{pg\-Check\-Hard\-Disk\-Space}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Check\-Hard\-Disk\-Space}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool I\-Pale\-Gem\-Framework\-::pg\-Check\-Hard\-Disk\-Space (
\begin{DoxyParamCaption}
\item[{const D\-W\-O\-R\-D\-L\-O\-N\-G}]{space\-Needed}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_ab5cec8d061abddec90a2bb9d60328ab0}


Checks available memory on harddisk and returns true if theres enough. 

space\-Needed The space to check for in bytes \begin{DoxyReturn}{Returns}
True if there's enough space to host space\-Needed 
\end{DoxyReturn}


Implemented in \hyperlink{classpg_pale_gem_framework_af75e15c52ee41abbf38ee2a754100e3a}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_a767e1c3dbaf56507a3abef6908cb5fe7}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Check\-R\-A\-M@{pg\-Check\-R\-A\-M}}
\index{pg\-Check\-R\-A\-M@{pg\-Check\-R\-A\-M}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Check\-R\-A\-M}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool I\-Pale\-Gem\-Framework\-::pg\-Check\-R\-A\-M (
\begin{DoxyParamCaption}
\item[{const D\-W\-O\-R\-D\-L\-O\-N\-G}]{space\-Needed}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_a767e1c3dbaf56507a3abef6908cb5fe7}


Implemented in \hyperlink{classpg_pale_gem_framework_a6f4be711dc51000bd57c7a72a3b015eb}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_a16db0befad9f653ef6217aecba83087c}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Do\-Message\-Loop@{pg\-Do\-Message\-Loop}}
\index{pg\-Do\-Message\-Loop@{pg\-Do\-Message\-Loop}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Do\-Message\-Loop}]{\setlength{\rightskip}{0pt plus 5cm}virtual void I\-Pale\-Gem\-Framework\-::pg\-Do\-Message\-Loop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_a16db0befad9f653ef6217aecba83087c}


Enters the windows message loop. 

\begin{DoxySeeAlso}{See Also}
Updating your game 
\end{DoxySeeAlso}


Implemented in \hyperlink{classpg_pale_gem_framework_a80308dc4904ac802855a65a4628d9b36}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_a8f309099c288fbd27be3a1131107b056}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Do\-Message\-Loop@{pg\-Do\-Message\-Loop}}
\index{pg\-Do\-Message\-Loop@{pg\-Do\-Message\-Loop}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Do\-Message\-Loop}]{\setlength{\rightskip}{0pt plus 5cm}virtual void I\-Pale\-Gem\-Framework\-::pg\-Do\-Message\-Loop (
\begin{DoxyParamCaption}
\item[{int($\ast$)(float f\-Frame\-Time)}]{Update\-Function}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_a8f309099c288fbd27be3a1131107b056}


Enters the windows message loop and calls Update\-Function before updating the engine. 


\begin{DoxyParams}{Parameters}
{\em Update\-Function} & Pointer to your game's update function. \\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See Also}
Updating your game 
\end{DoxySeeAlso}


Implemented in \hyperlink{classpg_pale_gem_framework_af9fe0abcf9606ebcea8fa752fd1df9e5}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_a7c0722e2ecb292f82771bfc4dde2c92b}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Exit@{pg\-Exit}}
\index{pg\-Exit@{pg\-Exit}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Exit}]{\setlength{\rightskip}{0pt plus 5cm}virtual H\-R\-E\-S\-U\-L\-T I\-Pale\-Gem\-Framework\-::pg\-Exit (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_a7c0722e2ecb292f82771bfc4dde2c92b}


Shuts the engine down. 



Implemented in \hyperlink{classpg_pale_gem_framework_a865c1af190c75c69d0cf7855957f038d}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_ad0723b0f1d9f8b8e4baeb1916000f00a}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Init@{pg\-Init}}
\index{pg\-Init@{pg\-Init}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Init}]{\setlength{\rightskip}{0pt plus 5cm}virtual H\-R\-E\-S\-U\-L\-T I\-Pale\-Gem\-Framework\-::pg\-Init (
\begin{DoxyParamCaption}
\item[{H\-I\-N\-S\-T\-A\-N\-C\-E}]{h\-Instance, }
\item[{int}]{cmd\-Show, }
\item[{L\-P\-C\-W\-S\-T\-R}]{lp\-Game\-Title}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_ad0723b0f1d9f8b8e4baeb1916000f00a}


Initialises the game engine and creates a game window. 


\begin{DoxyParams}{Parameters}
{\em h\-Instance} & H\-I\-N\-S\-T\-A\-N\-C\-E arg of Win\-Main \\
\hline
{\em cmd\-Show} & n\-Cmd\-Show of Win\-Main \\
\hline
{\em lp\-Game\-Title} & Name of the game, will also be name of the windowclass and windowtitle \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
S\-\_\-\-O\-K if everything went well otherwise see log 
\end{DoxyReturn}


Implemented in \hyperlink{classpg_pale_gem_framework_a46312d0a1988e49366fad2582e0b7b25}{pg\-Pale\-Gem\-Framework}.

\hypertarget{class_i_pale_gem_framework_a265588dcd93528d4449aa244fed92f56}{\index{I\-Pale\-Gem\-Framework@{I\-Pale\-Gem\-Framework}!pg\-Update@{pg\-Update}}
\index{pg\-Update@{pg\-Update}!IPaleGemFramework@{I\-Pale\-Gem\-Framework}}
\subsubsection[{pg\-Update}]{\setlength{\rightskip}{0pt plus 5cm}virtual void I\-Pale\-Gem\-Framework\-::pg\-Update (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [pure virtual]}}}\label{class_i_pale_gem_framework_a265588dcd93528d4449aa244fed92f56}


Updates the engine and its subsystems. 



Implemented in \hyperlink{classpg_pale_gem_framework_a12b9a4df14933e5bc2b41e9ceb081c60}{pg\-Pale\-Gem\-Framework}.



The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Inc/\hyperlink{_i_pale_gem_framework_8h}{I\-Pale\-Gem\-Framework.\-h}\end{DoxyCompactItemize}
